package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseReq;
import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.Comment;
import com.cskaoyan.bean.data.CommentData;
import com.cskaoyan.service.AdminCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author: heliming
 * @date: 2021/6/4
 * @description:
 */
@RestController
@RequestMapping("admin/comment")
public class AdminCommentController {

    @Autowired
    AdminCommentService adminCommentService;


    @GetMapping("list")
    public BaseRespVo list(Integer page, Integer limit, String sort, String order,Integer valueId,Integer userId) {

        CommentData commentData = adminCommentService.selectCommentData(page, limit, sort, order,valueId,userId);

        return BaseRespVo.ok(commentData);
    }


    @PostMapping("delete")
    public BaseRespVo delete(@RequestBody Comment comment) {

        adminCommentService.deleteComment(comment);
        return BaseRespVo.ok();
    }

}
